package com.tianqi.rms.util;

import com.jfinal.weixin.sdk.api.ApiConfigKit;

public class OauthUtils {

	public static String publicOauth(String redirect_uri){
		String url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect";
		try {
			String appid = ApiConfigKit.getAppId();
			String state="1";
			String scope="snsapi_base";//
			url=url.replace("APPID", appid);
			url=url.replace("REDIRECT_URI", redirect_uri);
			url=url.replace("SCOPE", scope);
			url=url.replace("STATE", state);
			return url;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
}
